package servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import domainObjects.Dossier;
import beans.DossierBean;

/**
 * Servlet implementation class RechercherDossier
 */
public class RechercherDossierParNom extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public RechercherDossierParNom() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {	
		if(request.getSession().getAttribute("DossierBean") == null)
		{
			DossierBean dossierBean = new DossierBean();
			request.getSession().setAttribute("DossierBean", dossierBean);
		}// Scope: Session 
		String prenom = request.getParameter("prenom");
	 	String nom = request.getParameter("nom");
	 	response.sendRedirect ("/equipe6-log720-A11-lab2/SelectionDossier.jsp?nom="+nom+"&prenom="+prenom); // redirection 
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
